<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="app" uri="/application" %>
<%@ taglib  prefix="s"  uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="/css/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="all_main">
  <div class="head_main">
    <div class="main_nav">推送列表</div>
    <div class="main_soso">
    <form action="/campaign/search_report.shtml">
    	<!-- 
    	    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
		    <td width="19" height="30" align="center"><img src="../images/clean_011.gif" width="16" height="16" /></td>
		    <td>
		       adId：
		      <input name="aar.adId" type="text" value="${aar.adId}" style="width:80px;" onkeypress="util.justNum();" class="inputwidth01" maxlength="30" />&nbsp;&nbsp;
		       publicId：  
		      <input name="aar.publicId" type="text" value="${aar.publicId}" style="width:180px;"  class="inputwidth01" maxlength="80" />&nbsp;&nbsp;
		       
		       开始时间:
		      <input name="beginDate" value="<fmt:formatDate value="${beginDate}" pattern="yyyy-MM-dd"/>" type="text" class="date_type" id="textfield" readonly="readonly"  onclick="new Calendar().show(this);"/>
		       结束时间: 
		      <input name="endDate" value="<fmt:formatDate value="${endDate}" pattern="yyyy-MM-dd"/>" type="text" class="date_type" id="textfield" readonly="readonly"  onclick="new Calendar().show(this);"/>
		      </td>
		    <td align="left">
		      <input name="input7" type="submit" class="input01" value="搜索" /></td>
		  </tr>
		</table>
    	 -->
    </form>
    </div>
    <div class="main_title">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <th width="10%">adId</th>
          <th width="20%">广告名称</th>
          <th width="10%">推送权重</th>
          <th width="10%">所有权重</th>
          <th width="10%">投放价格</th>
          <th width="10%">概率</th>
          <th width="10%">操作</th>
          <th></th>
        </tr>
      </table>
    </div>
  </div>
  <div class="content_main">
    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="background_hegh01">
       <tbody class="split">
	      <c:forEach items="${page_list.list}" var="o">
	             <fmt:parseNumber var="total" value="${level}" pattern="0.00" type="percent" />
	             <fmt:parseNumber var="lev" value="${o.level}" pattern="0.00" type="percent" />
		      <tr>
		         <td width="10%"> <c:out value="${o.adId}" ></c:out>  </td>
		         <td width="20%"><c:out value="${o.adName}" ></c:out></td>
		         <td width="10%"> <input value="<c:out value="${o.level}" ></c:out>" name="leval" id="leval_${o.adId}" size="8" maxlength="5" onkeydown="util.justNum();" />   </td>
		         <td width="10%">${level}</td>
		         <td width="10%">${o.price}元</td>
		         <td width="10%">
			         <c:choose>
		                <c:when test="${total!=0}"><fmt:formatNumber pattern="#0.00" value="${(lev/total)*100}"  ></fmt:formatNumber>%</c:when>
		                <c:otherwise>0.00%</c:otherwise>
		             </c:choose>
		         </td>
		         <td width="10%"><input  type="button" value="修改权重" onclick="updateLevel(${o.adId})"/></td>
		         <td>&nbsp;</td>
		      </tr>
	      </c:forEach>
      
	    </tbody>
    </table>
  </div>
  
  <app:page></app:page>
</div>
</body>
</html>
<script  src="/scripts/util.js" type="text/javascript"></script>
<script type="text/javascript" src="/scripts/calendar.js"></script>
<script type="text/javascript" src="/scripts/common.js"></script>
<script type="text/javascript" >
   
  function updateLevel(adId){
     var level = util.$("leval_"+adId).value;
     if(confirm('确定修改权重?')){
    	 window.location='/campaign/update_push_leval.shtml?id='+adId+"&level="+level; 
     }
  }

</script>
